//
//  ItemView.m
//  SimpleHappy
//
//  Created by 张超 on 15/11/25.
//  Copyright © 2015年 RockyFung. All rights reserved.
//

#import "ItemView.h"
#import "Define.h"
#import "SHRegistView.h"
@interface ItemView ()

@end

@implementation ItemView

- (void)viewDidLoad {
    [super viewDidLoad];

//    UIView *itemView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight * 0.07)];
    
    UIButton *backBtn = [[UIButton alloc]initWithFrame:CGRectMake(10, KScreenWidth / 18.75, KScreenWidth / 10, KScreenWidth / 10)];
    [backBtn setImage:[UIImage imageNamed:@"xia"] forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:backBtn];
    
    CGFloat width = KScreenWidth - backBtn.frame.size.width * 2;
    self.myTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(KScreenWidth / 18.75 * 2, KScreenWidth / 18.75, width, KScreenHeight / 16.68)];
    self.myTitleLabel.textAlignment = NSTextAlignmentCenter;
    self.myTitleLabel.font = [UIFont systemFontOfSize:KScreenWidth / 20.83];
    self.myTitleLabel.text = @"登 录";
    [self.view addSubview:self.myTitleLabel];
    
    self.registBtn = [[UIButton alloc]initWithFrame:CGRectMake(backBtn.bounds.size.width + self.myTitleLabel.bounds.size.width - KScreenWidth / 18.75, KScreenWidth / 15.75, KScreenWidth / 7, KScreenWidth / 10)];
    [self.registBtn setTitle:@"注 册" forState:UIControlStateNormal];
    [self.registBtn addTarget:self action:@selector(registAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.registBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.view addSubview:self.registBtn];

    
//    [self.view addSubview:itemView];
}


#pragma mark - 返回按钮的方法
- (void)backAction:(UIButton *)btn
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - 注册按钮的方法
- (void)registAction:(UIButton *)btn
{
    SHRegistView *registViewVc = [[SHRegistView alloc]init];
    [self presentViewController:registViewVc animated:YES completion:nil];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
